package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_user")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GuUser extends Model<GuUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    /**
     * steamId
     */
    private String userSteamId;

    /**
     * 昵称
     */
    private String userNickname;

    /**
     * 密码
     */
    @JsonIgnore
    private String userPassword;

    /**
     * 头像
     */
    private String userImage;

    /**
     * 手机号Or邮箱
     */
    @JsonIgnore
    private String userAccount;
    @TableField(exist = false)
    private String userAccountShow;

    /**
     * 交易链接
     */
    private String userTradingUrl;

    /**
     * 经验
     */
    private BigDecimal userLevelExperience;

    /**
     * 余额
     */
    private BigDecimal userGuCurrency;

    /**
     * 每日抽奖次数
     *
     */
    private Integer userRevolutions;

    /**
     * 邀请码
     */
    private String userInviteCode;

    /**
     * 邀请码过期时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime userInviteExp;

    /**
     * 邀请人数
     */
    private Integer userInviteNumber;

    /**
     * 邀请收入
     */
    private BigDecimal userInviteIncome;

    /**
     * 1 主播账号
     */
    @JsonIgnore
    private Integer userType;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime userCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime userUpdateTime;
    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

}
